load ehiSCORE

load pureTotal27-1

gripLeft = [freqData{:,8}]';
gripRight = [freqData{:,9}]';
gripDiff = gripLeft - gripRight;

switchNWlow = [totalBiases{:,1}]';
switchNWmid = [totalBiases{:,2}]';
switchNWhigh = [totalBiases{:,3}]';

switchWlow = [totalBiases_weighted{:,1}]';
switchWmid = [totalBiases_weighted{:,2}]';
switchWhigh = [totalBiases_weighted{:,3}]';

switchDifflow = switchNWlow - switchWlow;
switchDiffmid = switchNWmid - switchWmid;
switchDiffhigh = switchNWhigh - switchWhigh;

clear freqData freqData_weighted totalBiases totalBiases_weighted totalDataL totalDataL_weighted totalDataR totalDataR_weighted;

corrTable = table(ehiSCORE,gripLeft,gripRight,gripDiff,switchNWlow,switchNWmid,switchNWhigh,switchWlow,switchWmid,switchWhigh,switchDifflow,switchDiffmid,switchDiffhigh);

clear ehiSCORE gripLeft gripRight gripDiff switchNWlow switchNWmid switchNWhigh switchWlow switchWmid switchWhigh switchDifflow switchDiffmid switchDiffhigh;

[rho,pval] = corr(table2array(corrTable));

[row col] = find(pval<.05 & pval > 0);

corrResults = [corrTable.Properties.VariableNames(row);corrTable.Properties.VariableNames(col);num2cell(rho(sub2ind(size(rho),row,col))');num2cell(pval(sub2ind(size(pval),row,col))')];

noCorr = (size(corrTable,2)^2-size(corrTable,2))/2;

bonfSignIndex = find([corrResults{4,:}] < (0.05/78));

SignIndex = find([corrResults{4,:}] > (0.05/78) & [corrResults{4,:}] < 0.05);